package utils


import xml.{Elem, PrettyPrinter}

/**
 * zhu.tan@gmail.com
 * 21-Aug-2009
 */

object PrettyPrint {
  def pretty(elem: Elem) {
    println(new PrettyPrinter(80 /*width*/ , 3 /*indent*/ ).format(elem))
  }

  def pretty[T](xs: {def foreach(f: (T) => Unit): Unit}) {
    var sum = 1
    xs.foreach(x => {
      print(sum + " --- ")
      sum += 1
      println(x)
    })
  }

}